State diagramming environments provide graphical design and development tools for modeling and simulating event driven systems and subsystems. These environments may describe system behavior using state diagrams, which can include both logic and internal data and can be used to visually display a current state during the operation of the system being modeled. State diagramming environments may allow users to graphically represent hierarchical and parallel states of systems and event-driven transitions between states.
A state diagram, or statechart, contains “states” that may represent the mode of an object in an instant in time. A state in a state diagram can include a variable and an action. State diagrams and statecharts can be hierarchical and can contain parallel elements. States may exist within other states. A state within a state is sometimes referred to as a sub-state. A state that contains sub-states is said to be a parent state. The sub-states within the parent state are also known as its children, its child states or its decendants. States within a state diagram may be parallel states, also known as “AND” states. Multiple parallel states, usually denoted by a dotted outline, may be active simultaneously. Changes from one state to another are “transitions”. These “transitions” are triggered by “events” and send the “event” from one state to another. “Actions” take place during the execution of a state diagram. An action can occur upon entering a state, while in a state, upon leaving a state, upon a transition, upon evaluating a condition, etc.
A broadcast may send an event to one or more states that are not connected by a transition. The broadcast may trigger transitions or actions in other portions of the state diagram. Broadcasting an event is useful as a means of synchronization among parallel states. A directed broadcast may send a specific event to a specific receiver state. A local broadcast may send an event to the parent state of the event that triggered it and the other descendents of the parent state. A local broadcast can be immediate and “blocking”, i.e. the currently active event is suspended and the destination state may be evaluated with the new event as the active event. Only after the destination state evaluation is finished, does the processing return to the active event that sent the broadcast.
Unfortunately, the “blocking” associated with local broadcasts can have disadvantages. One such disadvantage can be that a blocking local broadcast between parallel states can lead to at least one state within that parallel configuration being processed twice. Additionally, the “blocking” associated with recursive event broadcasts may lead to cyclic behavior which can only be detected during simulation. The blocking behavior of local broadcasts also results in difficulties implementing the state diagram in hardware. In order to implement blocking in a computer-based state diagramming environment, the environment must have some storage (such as a stack) to keep track of the event that has been suspended while the state that received the broadcast finishes processing. A state diagram incorporating blocking broadcasts may not simply translate into hardware as it may require an infinitely large event stack. A state diagram with only non-blocking event processing may be more simply implemented in hardware as it does not require an event stack.